package com.hns.can.service.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hns.can.common.domain.GridPage;
import com.hns.can.common.service.CommonInitParamService;
import com.hns.can.common.vo.CommonParamsVo;
import com.hns.can.common.web.BaseController;
import com.hns.can.service.service.ElectronicSignsService;
import com.hns.frame.mybatis.Pagination;

/**
 * 电子站牌controller
 * @author:zhangy
 * @email:zhangyu2222z@sina.cn
 * @version Revision 2.0.0
 */
@Controller
@RequestMapping("electronicSign")
public class ElectronicSignController extends BaseController {
	@Autowired
	private ElectronicSignsService electronicSignsService;
	
	@Autowired
	private CommonInitParamService commonInitParamService;
	
	/**
	 * 电子路牌统计
	 * @param params
	 * @return
	 * @throws Exception
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@SuppressWarnings("rawtypes")
	@RequestMapping("getElectronicSignCountData")
	@ResponseBody
	public Object getElectronicSignCountData(CommonParamsVo params) throws Exception{
		commonInitParamService.initParamsLimitLine(params, this.getCurrentUser().getUser(), null);
		List list = electronicSignsService.getElectronicSignCountData(params);
		return this.getReturnResult(list);
	}
	
	/**
	 * 电子路牌明细
	 * @param params
	 * @return
	 * @author:zhangy
	 * @email:zhangyu2222z@sina.cn
	 */
	@RequestMapping("getElectronicSignDetail")
	@ResponseBody
	public Object getElectronicSignDetail(CommonParamsVo params) throws Exception{
		params.setCorpId(this.getCurrentUser().getUser().getCorpId());
		Pagination page = electronicSignsService.getElectronicSignDetail(params);
		GridPage grid = new GridPage(page);
		return this.getReturnResult(grid);
	}
	
}
